The present invention relates to a pulse width modulator and a pulse width modulation method.
The present application claims priority from Japanese Application No.2002-188319, the disclosure of which is incorporated herein by reference.
In the field involving digital signal processing such as the audio video technology, the communication technology, and the computer technology, PCM (pulse code modulated) data trains may be converted into PWM (pulse width modulation) signals for processing.
For example, a digital amplifier is conventionally known which performs a PCM to PWM conversion on a PCM data train, such as speech or music, reproduced such as with a CD (Compact Disc) player or a DVD (Digital Versatile Disc) player, to derive a PWM signal, which is in turn used to control a current supplied to a loudspeaker or the like, thereby providing a sound corresponding to the PWM signal.
In general, such a method as shown in FIG. 7A is employed to perform the PCM to PWM conversion.
First, a PCM data train Xn shown in a step-wise shape in FIG. 7A is generated by sampling an analog sound signal shown by a dotted line at a predetermined sampling frequency fs.
Upon the PCM to PWM conversion of such a PCM data train Xn, a comparison operation is performed between the PCM data train Xn and a sawtooth wave reference signal R(t) synchronous with the aforementioned sampling frequency fs.
Then, a square wave signal Su, as shown in FIG. 7C, is produced which is inverted to the logic “H” at start points in time (see t3 and t6) in a sampling period (1/fs) and inverted to the logic “L” at points in time (see t1 and t5) at which the slope portion of the reference signal R(t) intersects the PCM data train Xn. This signal Su is defined as a PWM signal.
The method for converting the PCM data train Xn into the PWM signal is referred to as the UPWM (Uniform Sampling PWM) modulation.
In some cases, since the PCM data train Xn shown in FIG. 7A is discrete, the point in time at which a sample value thereof intersects the reference signal R(t) may differ from the point in time at which the original analog signal x(t) intersects the reference signal R(t).
For this reason, when compared with a PWM signal generated directly from an analog signal by the NPWM (Natural Sampling PWM) modulation, the PWM signal Su obtained by the aforementioned UPWM modulation may contain nonlinear distortion, thereby raising a problem of causing distortion in reproduced sound, for example, upon allowing the aforementioned loudspeaker or the like to sound.
That is, as shown in FIG. 7B, the NPWM modulation compares the original analog signal X(t) with the aforementioned reference signal R(t) and then generates, as shown by the signal SN in FIG. 7C, a square wave PWM signal SN which is inverted to the logic “H” at start points in time (see t3 and t6) in the sampling period (1/fs) and inverted to the logic “L” at points in time (see t2 and t4) at which the slope portion of the reference signal R(t) intersects the analog signal X(t).
Accordingly, as can be seen from FIG. 7C, even for the same original analog signal X(t), the PWM signal Su provided by the UPWM modulation and the PWM signal SN provided by the NPWM modulation are in the logic “H” or the logic “L” for different lengths of time in each sampling period (1/fs), thereby causing a problem of making it difficult to provide a high quality reproduction of sound when the aforementioned loudspeaker or the like is allowed to sound in accordance with the PWM signal Su.
In this context, interpolation processing is performed to generate a PWM signal having reduced nonlinear distortion.
FIG. 8 is a view showing a conventionally practiced interpolation method, shown in contrast to FIG. 7A. This interpolation method is referred to as the LPWM (linearized PWM) modulation.
Referring to FIG. 8, the period To from a point in time ta to tb equals each sampling period (1/fs) and is normalized to be unity. Each amplitude of the PCM data train Xn and the reference signal R(t) is also normalized within the range of ±1.
In each sampling period To with the start point in time ta being a reference time (t=0), a point in time tp at which a straight line S(t) connecting between sample values X1 and X2 of the PCM data train Xn at the start point in time ta and the end point in time tb intersects the reference signal R(t) is determined to produce the PWM signal Su.
That is, the straight line S(t) in each sampling period To is expressed by the following equation (1) and the reference signal R(t) is expressed by the following equation (2):S(t)=(X2−X1)t+X1  (1)R(t)=2t−1  (2)
The point in time tp at which the straight line S(t) intersects the reference signal R(t) and the amplitude value Xp at the point in time tp are determined by the following equations (3) and (4):tp=(X1+1)/(2−X2+X1)  (3)Xp=(X1+X2)/(2−X2+X1)  (4)
The aforementioned equations (1) to (4) are expressed with the point in time ta defined as the origin of the sampling period To (i.e., t=0) and the point in time tb defined as t=1.
A square wave signal which is inverted to the logic “H” at the start point in time ta in the sampling period To, inverted to the logic “L” at the point in time tp, and inverted again to the logic “H” at the end point in time tb is defined as an interpolated PWM signal Su.
According to this interpolation processing, since the point in time tp is close to a point in time t2 of the PWM signal SN shown in FIG. 7C, it is possible for the PWM signal Su to approach the PWM signal SN.
However, as shown by the aforementioned equations (3) and (4), the prior art interpolation method required a division operation to determine the coordinates (tp, Xp) at the point in time tp at which the logic state of the PWM signal Su is inverted, thus raising a problem of requiring many computation steps.
In particular, when the PWM signal Su is produced while the aforementioned interpolation processing is performed on a PCM data train sampled at a higher sampling frequency or on a PCM data train to be generated from data containing many bits (many levels of quantization), the aforementioned division operation resulted in many computation steps and thereby required a long time for the PCM to PWM conversion, thus raising a problem of making it difficult to perform signal processing at high speeds.